package com.matt.foundation.vo;

import com.matt.domain.Children;
import com.matt.domain.ChildrenHealthBaseInfo;
import com.matt.foundation.utils.DateUtil;
import lombok.Data;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/11/1
 * *******************************
 */
@Data
public class ChildrenHealthListVo {
    private String healthBaseInfoId;
    private String name;
    private String month;
    private String height;
    private String weight;
    private String header;
    private String createTime;
    private String evaluateTime;

    public static ChildrenHealthListVo of(Children children, ChildrenHealthBaseInfo healthBaseInfo) {
        ChildrenHealthListVo vo = new ChildrenHealthListVo();
        vo.setHealthBaseInfoId(healthBaseInfo.getId());
        vo.setName(healthBaseInfo.getEvaluateName());
        vo.setMonth(healthBaseInfo.getMonth().toString());
        vo.setHeight(healthBaseInfo.getPhysicalHeight());
        vo.setWeight(healthBaseInfo.getPhysicalWeight());
        vo.setHeader(healthBaseInfo.getPhysicalHeader());
        vo.setCreateTime(DateUtil.millisToDateTime(healthBaseInfo.getCreated().getTime(), "yyyy-MM-dd"));
        vo.setEvaluateTime(DateUtil.millisToDateTime(healthBaseInfo.getEvaluateTime().getTime(), "yyyy-MM-dd"));
        return vo;
    }
}
